home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
START Magazine
/
START VOL 3 NO 12.st
/
STYLIST.ARC
/
STYLIST.LST
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
File List
|
1989-04-11
|
34.5 KB
|
1,156 lines
'
' Sound-Aid
' by Sal Gutierrez
'
' Copyright 1989 Antic Publishing
'
Desk_color_0=Xbios(7,0,-1) ! Save Desktop Color Palette
Desk_color_1=Xbios(7,1,-1)
Desk_color_2=Xbios(7,2,-1)
Desk_color_3=Xbios(7,3,-1)
Res%=Xbios(4)
Med%=1
High%=2
If Res%=Med%
' Setcolor 0,0,0,6
' Setcolor 1,6,6,7
' Setcolor 2,6,0,0
Endif
Dim Volume%(3),Ptch%(3),Scale%(3),Dur%(3),S_dur%(5),W_dur%(5),F_len%(5)
Dim T_vol%(3,64),T_pitch%(3,64),T_octave%(3,64),T_sdur%(3,64),Zero_flag%(3)
Dim T_voice%(64),T_env%(64),T_form%(64),T_len%(64),T_wdur%(64),Hear_sound%(3)
Dim Voice%(2),Parameter$(5),Voice_box%(6),Env_box%(3),Flag_dup%(3)
Delay%=4
Y_ticker%=133
X_old_form%=350
Y_old_form%=13
Mode_direct%=1
Mode_all%=2
Mode_rewind%=3
Mode_ff%=4
Adjust_increase%=1
Adjust_decrease%=-1
Rem
Gosub Screen_initialize
Rem
Rem *************************************************************************
Rem
Do
Rem ! CHECK FF, REW, PLAY STATUS
If Mode%=Mode_direct% And Flag_sound_change%=1 ! Play Sounds Now
Gosub Hear_it
Flag_sound_change%=0
Goto Check_mouse
Endif
If Mode%=Mode_all% ! Play Recorded Tape
If Rec_counter%>Tape_counter% Or Rec_counter%=63
J%=Tape_counter%
For I%=1 To 3
If T_vol%(I%,J%) Or Zero_flag%(I%)
Sound I%,T_vol%(I%,J%),T_pitch%(I%,J%),T_octave%(I%,J%),T_sdur%(I%,J%)
If T_vol%(I%,J%)
Zero_flag%(I%)=1
Else
Zero_flag%(I%)=0
Endif
Endif
Next I%
If T_voice%(J%)
Wave T_voice%(J%),T_env%(J%),T_form%(J%),T_len%(J%),T_wdur%(J%)
Endif
If Tape_counter%=63
Gosub Tape_stop
Else
Gosub Tape_forward
Endif
Goto Check_mouse
Else
Gosub Tape_stop
Goto Check_mouse
Endif
Endif
If Mode%=Mode_ff% ! Fast Forward Tape
If Rec_counter%>Tape_counter% And Tape_counter%<63
Gosub Tape_forward
Else
Gosub Tape_stop
Endif
Goto Check_mouse
Endif
If Mode%=Mode_rewind% ! Rewind Tape
If Tape_counter%>0
Gosub Tape_rewind
Goto Check_mouse
Else
Gosub Tape_stop
Goto Check_mouse
Endif
Endif
Rem ---------------------------------------------------------------------
Check_mouse:
Mouse X%,Y%,K%
Y%=Y%/Res%
If K%=1
If (X%>502 And X%<634) And (Y%>108 And Y%<128) ! QUIT
Repeat
Mouse D%,D%,K%
Until K%=0
Alert 1,"Do you really want to quit?",1,"Ok|Cancel",D%
If D%=1
Sound 0,0,0,0,0
Sound 1,0,0,0,0
Sound 3,0,0,0,0
Wave 0,0
If Res%=Med%
Void Xbios(7,0,Desk_color_0)
Void Xbios(7,1,Desk_color_1)
Void Xbios(7,2,Desk_color_2)
Void Xbios(7,3,Desk_color_3)
Endif
' End
Edit
Endif
Endif
If (X%>90 And X%<323) And (Y%>184 And Y%<196)
While Mousek<>0
Wend
Alert 1,"The Sound Wave Stylist| by Sal Gutierrez|"+Chr$(189)+" 1989 Antic Publishing",1," Ok ",D%
Endif
Rem ********************************************************************
Rem * SOUND COMMAND SECTION *
Rem ********************************************************************
Rem
Check_sound:
If X%>92 And X%<339 ! CHECK IF SOUND 1, 2, OR 3
' Graphmode 2
Deffill 2
If Y%>12 And Y%<44 ! Sound 1
Register%=1
Register_y%=31
Goto Tone_process_1
Endif
If Y%>50 And Y%<82 ! Sound 2
Register%=2
Register_y%=69
Goto Tone_process_1
Endif
If Y%>88 And Y%<120 ! Sound 3
Register%=3
Register_y%=107
Goto Tone_process_1
Else
Goto Check_wave
Endif
Else
Goto Check_wave
Endif
Rem ----------------------------------------------------------------------
Rem
Rem ! DETERMINE SOUND INCREASE OR DECREASE
Tone_process_1:
If (Y%>12 And Y%<23) Or (Y%>50 And Y%<61) Or (Y%>88 And Y%<99)
Adjust%=Adjust_increase%
Goto Tone_process_2
Endif
If (Y%>33 And Y%<44) Or (Y%>71 And Y%<82) Or (Y%>109 And Y%<120)
Adjust%=Adjust_decrease%
Goto Tone_process_2
Else
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
Tone_process_2: ! CHECK AND CHANGE VOLUME
If X%>92 And X%<160
If Volume%(Register%)=0 And Adjust%=Adjust_increase%
Ptch%(Register%)=1
Scale%(Register%)=1
Graphmode 1
Text 185,Register_y%*Res%," "
Text 245,Register_y%*Res%," "
Text 185,Register_y%*Res%,Ptch%(Register%)
Text 245,Register_y%*Res%,Scale%(Register%)
Endif
Add Volume%(Register%),Adjust%
If Volume%(Register%)<1
Volume%(Register%)=0
Ptch%(Register%)=0
Scale%(Register%)=0
Dur%(Register%)=0
Graphmode 1
Text 185,Register_y%*Res%," "
Text 245,Register_y%*Res%," "
Text 185,Register_y%*Res%,Ptch%(Register%)
Text 245,Register_y%*Res%,Scale%(Register%)
For I%=282 To 330 Step 12
Text I%,Register_y%*Res%," "
Text I%,Register_y%*Res%,"0"
Next I%
Endif
If Volume%(Register%)>15
Volume%(Register%)=15
Endif
Graphmode 1
Text 123,Register_y%*Res%," "
Text 123,Register_y%*Res%,Volume%(Register%)
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ------------------------------------------------------------------
If X%>160 And X%<216 ! CHECK AND CHANGE PITCH
If Volume%(Register%)
Add Ptch%(Register%),Adjust%
If Ptch%(Register%)<1
Dec Scale%(Register%)
If Scale%(Register%)<1
Scale%(Register%)=1
Ptch%(Register%)=1
Else
Ptch%(Register%)=12
Endif
Endif
If Ptch%(Register%)>12
Inc Scale%(Register%)
If Scale%(Register%)>8
Scale%(Register%)=8
Ptch%(Register%)=12
Else
Ptch%(Register%)=1
Endif
Endif
Graphmode 1
Text 185,Register_y%*Res%," "
Text 245,Register_y%*Res%," "
Text 185,Register_y%*Res%,Ptch%(Register%)
Text 245,Register_y%*Res%,Scale%(Register%)
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
If X%>216 And X%<280 ! CHECK AND CHANGE OCTAVE
If Volume%(Register%)
Add Scale%(Register%),Adjust%
If Scale%(Register%)<1
Scale%(Register%)=1
Endif
If Scale%(Register%)>8
Scale%(Register%)=8
Endif
Graphmode 1
Text 245,Register_y%*Res%," "
Text 245,Register_y%*Res%,Scale%(Register%)
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
If X%>280 And X%<339 ! CHECK AND CHANGE DURATION
If Volume%(Register%)
Temp%=Dur%(Register%)
If X%>280 And X%<292
Place%=10000
Endif
If X%>292 And X%<304
Place%=1000
Endif
If X%>304 And X%<316
Place%=100
Endif
If X%>316 And X%<328
Place%=10
Endif
If X%>328 And X%<339
Place%=1
Endif
Add Temp%,Adjust%*Place%
If Temp%>=0 And Temp%=<65535
Dur%(Register%)=Temp%
Num%=10000
For I%=1 To 5
S_dur%(I%)=Int(Temp%/Num%)
Sub Temp%,S_dur%(I%)*Num%
Div Num%,10
Next I%
Graphmode 1
Text 282,Register_y%*Res%," "
Text 294,Register_y%*Res%," "
Text 306,Register_y%*Res%," "
Text 318,Register_y%*Res%," "
Text 330,Register_y%*Res%," "
Text 282,Register_y%*Res%,S_dur%(1)
Text 294,Register_y%*Res%,S_dur%(2)
Text 306,Register_y%*Res%,S_dur%(3)
Text 318,Register_y%*Res%,S_dur%(4)
Text 330,Register_y%*Res%,S_dur%(5)
Endif
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem **********************************************************************
Rem * WAVE COMMAND PROCESS *
Rem **********************************************************************
Rem
Check_wave: ! CHECK IF WAVE
If X%>91 And X%<323 ! DETERMINE INCREASE/DECREASE
Graphmode 1
Deffill 2
If Y%>149 And Y%<160
Adjust%=Adjust_increase%
Goto Noise_process_1
Endif
If Y%>170 And Y%<181
Adjust%=Adjust_decrease%
Goto Noise_process_1
Endif
Goto Check_form
Else
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
Noise_process_1: ! CHECK AND CHANGE VOICE
If X%>91 And X%<115
Temp%=Voice%(0)
If X%>91 And X%<103
Place%=10
Endif
If X%>103 And X%<115
Place%=1
Endif
Add Temp%,Adjust%*Place%
If Temp%>=0 And Temp%=<63
Voice%(0)=Temp%
Voice%(1)=Int(Voice%(0)/10)
Voice%(2)=Voice%(0)-Voice%(1)*10
Graphmode 1
Text 93,168*Res%," "
Text 105,168*Res%," "
Text 93,168*Res%,Voice%(1)
Text 105,168*Res%,Voice%(2)
Gosub Set_voice_box
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
If X%>115 And X%<159 ! CHECK AND CHANGE ENVELOPE
Temp%=Envelope%
Add Temp%,Adjust%
If Temp%>=0 And Temp%=<7
Envelope%=Temp%
Graphmode 1
Text 133,168*Res%," "
Text 133,168*Res%,Envelope%
Gosub Set_env_box
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
If X%>159 And X%<203 ! CHECK AND CHANGE FORM
Temp%=Frm%
Add Temp%,Adjust%
If Temp%>=0 And Temp%=<15
Frm%=Temp%
Graphmode 1
Text 178,168*Res%," "
Text 178,168*Res%,Frm%
Gosub Set_form_box
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
If X%>203 And X%<263 ! CHECK AND CHANGE LENGTH
Temp%=F_len%(0)
If X%>203 And X%<215
Place%=10000
Endif
If X%>215 And X%<227
Place%=1000
Endif
If X%>227 And X%<239
Place%=100
Endif
If X%>239 And X%<251
Place%=10
Endif
If X%>251 And X%<263
Place%=1
Endif
Add Temp%,Adjust%*Place%
If Temp%>=0 And Temp%=<65535
F_len%(0)=Temp%
Num%=10000
For I%=1 To 5
F_len%(I%)=Int(Temp%/Num%)
Sub Temp%,F_len%(I%)*Num%
Div Num%,10
Next I%
Graphmode 1
Text 205,168*Res%," "
Text 217,168*Res%," "
Text 229,168*Res%," "
Text 241,168*Res%," "
Text 253,168*Res%," "
Text 205,168*Res%,F_len%(1)
Text 217,168*Res%,F_len%(2)
Text 229,168*Res%,F_len%(3)
Text 241,168*Res%,F_len%(4)
Text 253,168*Res%,F_len%(5)
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem ----------------------------------------------------------------------
If X%>263 And X%<323 ! CHECK AND CHANGE WAVE DURATION
Temp%=W_dur%(0)
If X%>263 And X%<275
Place%=10000
Endif
If X%>275 And X%<287
Place%=1000
Endif
If X%>287 And X%<299
Place%=100
Endif
If X%>299 And X%<311
Place%=10
Endif
If X%>311 And X%<323
Place%=1
Endif
Add Temp%,Adjust%*Place%
If Temp%>=0 And Temp%=<65535
W_dur%(0)=Temp%
Num%=10000
For I%=1 To 5
W_dur%(I%)=Int(Temp%/Num%)
Sub Temp%,W_dur%(I%)*Num%
Div Num%,10
Next I%
Graphmode 1
Text 265,168*Res%," "
Text 277,168*Res%," "
Text 289,168*Res%," "
Text 301,168*Res%," "
Text 313,168*Res%," "
Text 265,168*Res%,W_dur%(1)
Text 277,168*Res%,W_dur%(2)
Text 289,168*Res%,W_dur%(3)
Text 301,168*Res%,W_dur%(4)
Text 313,168*Res%,W_dur%(5)
Endif
Flag_sound_change%=1
Pause Delay%
Goto Check_form
Endif
Rem **********************************************************************
Rem * FORM, VOICE, & ENVELOPE INFO PROCESSING SECTION *
Rem **********************************************************************
Rem
Check_form:
Graphmode 3
If (X%>350 And X%<634) And (Y%>13 And Y%<63) ! CHECK FORM CHOICES
If X%>350 And X%<492
Number_choice%=0
X_new_form%=350
Else
Number_choice%=11
X_new_form%=492
Endif
For Y_new_form%=23 To 63 Step 10
If Y%<Y_new_form%
Graphmode 3
Pbox X_old_form%,Y_old_form%*Res%,X_old_form%+142,(Y_old_form%+10)*Res%
Pbox X_new_form%,(Y_new_form%-10)*Res%,X_new_form%+142,Y_new_form%*Res%
X_old_form%=X_new_form%
Y_old_form%=Y_new_form%-10
Frm%=Number_choice%
Graphmode 1
Text 178,168*Res%," "
Text 178,168*Res%,Frm%
Y_new_form%=63
Endif
If Number_choice%=0 Or Number_choice%=4
Add Number_choice%,3
Endif
Inc Number_choice%
Next Y_new_form%
Repeat
K%=Mousek
Until K%=0
Flag_sound_change%=1
Goto Process_done
Endif
Rem ----------------------------------------------------------------------
If (X%>350 And X%<495) And (Y%>79 And Y%<127) ! CHECK VOICE CHOICES
Number_choice%=1
I%=1
For Y_new_voice%=87 To 127 Step 8
If Y%<Y_new_voice%
Voice_box%(I%)=Voice_box%(I%) Xor 1
Graphmode 3
Pbox 350,(Y_new_voice%-8)*Res%,495,Y_new_voice%*Res%
Voice%(0)=Voice%(0) Xor Number_choice%
Voice%(1)=Int(Voice%(0)/10)
Voice%(2)=Voice%(0)-Int(Voice%(0)/10)*10
Graphmode 1
Text 93,168*Res%,Voice%(1)
Text 105,168*Res%,Voice%(2)
Y_new_voice%=127
Endif
Mul Number_choice%,2
Inc I%
Next Y_new_voice%
Repeat
K%=Mousek
Until K%=0
Flag_sound_change%=1
Goto Process_done
Endif
Rem ----------------------------------------------------------------------
If (X%>502 And X%<634) And (Y%>79 And Y%<103) ! CHECK ENV CHOICES
Number_choice%=1
I%=1
For Y_new_env%=87 To 103 Step 8
If Y%<Y_new_env%
Env_box%(I%)=Env_box%(I%) Xor 1
Graphmode 3
Pbox 502,(Y_new_env%-8)*Res%,634,Y_new_env%*Res%
Envelope%=Envelope% Xor Number_choice%
Graphmode 1
Text 133,168*Res%,Envelope%
Y_new_env%=103
Endif
Mul Number_choice%,2
Inc I%
Next Y_new_env%
Repeat
K%=Mousek
Until K%=0
Flag_sound_change%=1
Goto Process_done
Endif
Rem **********************************************************************
Rem * PLAYER PROCESSING SECTION *
Rem **********************************************************************
Rem
Check_player: ! CHECK FF AND REWIND STATUS
Graphmode 3
If X%>448 And X%<536 ! CHECK PLAY BUTTONS
If Y%>144 And Y%<156 ! Direct Play
Mode%=Mode_direct%
Gosub Toggle_buttons(449,145,535,155)
Endif
If Y%>156 And Y%<168 And Mode%=0 ! Current Play
Gosub Toggle_buttons(449,157,535,167)
Gosub Hear_it
Graphmode 3
Pbox 449,157*Res%,535,167*Res%
Toggle_flag%=0
Endif
If Y%>168 And Y%<180 ! All Play
If Tape_counter%<Rec_counter%
Mode%=Mode_all%
Gosub Toggle_buttons(449,169,535,179)
For I%=1 To 3
Zero_flag%(I%)=0
Next I%
Goto Process_done
Endif
Endif
Endif
Rem -----------------------------------------------------------------------
If X%>377 And X%<607 ! CHECK MOVEMENT BUTTONS
If Y%>180 And Y%<192 And Mode% ! stop Tape
Gosub Tape_stop
Goto Process_done
Endif
If X%>377 And X%<448 ! Rewind Tape
If Y%>168 And Y%<180 And Mode%=0
If Tape_counter%>0
Gosub Toggle_buttons(378,169,447,179)
Mode%=Mode_rewind%
Goto Process_done
Endif
Endif
Endif
If X%>536 And X%<607 ! Fast Forward Tape
If Y%>168 And Y%<180 And Mode%=0
If Rec_counter%>0
Gosub Toggle_buttons(537,169,606,179)
Mode%=Mode_ff%
Goto Process_done
Endif
Endif
Endif
Endif
Rem ----------------------------------------------------------------------
If Y%>150 And Y%<162 ! CHECK REC AND ERASE BUTTONS
If X%>392 And X%<432 And Tape_counter%<64 ! Record Button
Deffill 3
Pbox 393,151*Res%,431,161*Res% ! Highlight Rec button
For I%=1 To 3
T_vol%(I%,Tape_counter%)=Volume%(I%)
T_pitch%(I%,Tape_counter%)=Ptch%(I%)
T_octave%(I%,Tape_counter%)=Scale%(I%)
T_sdur%(I%,Tape_counter%)=Dur%(I%)
Next I%
T_voice%(Tape_counter%)=Voice%(0)
T_env%(Tape_counter%)=Envelope%
T_form%(Tape_counter%)=Frm%
T_len%(Tape_counter%)=F_len%(0)
T_wdur%(Tape_counter%)=W_dur%(0)
Repeat
K%=Mousek
If K%=3
Flag_carry_over%=1
Endif
Until K%=0
Deffill 1
Pbox 393,151*Res%,431,161*Res% ! Dehighlight button
If Rec_counter%=Tape_counter% And Rec_counter%<63
Inc Rec_counter%
Endif
Gosub Tape_forward
Goto Process_done
Endif
If X%>552 And X%<592 And Rec_counter% ! Erase Button
Repeat
Mouse D%,D%,K%
Until K%=0
Deffill 3
Pbox 553,151*Res%,591,161*Res%
Mode%=Mode_erase%
Alert 1,"|This Will Erase To|The End Of Tape!",1,"Erase|Abort",Button%
If Button%=1
Gosub Tape_erase
Rec_counter%=Tape_counter%
Endif
Deffill 1
Pbox 553,151*Res%,591,161*Res%
Goto Process_done
Endif
Endif
Rem ----------------------------------------------------------------------
If Y%>144 And Y%<192 ! CHECK LOAD AND SAVE
If X%>350 And X%<374 ! Load Recorded Tape
Fileselect "\*.LST","",File$
If File$=""
Goto Process_done
Endif
On Error Gosub Eof_error
Rec_counter%=0
For I%=0 To 3
Flag_dup%(I%)=0
Next I%
Tape_counter%=0
Gosub Tape_erase
File$=File$+".LST"
Open "I",#1,File$
Repeat
Inc Rec_counter%
Input #1,Parameter$(0)
If Left$(Parameter$(0),5)="Sound"
If Flag_dup%(0)=1
For C%=0 To 3
Flag_dup%(C%)=0
Next C%
Inc Rec_counter%
Endif
I%=Val(Right$(Parameter$(0),1))
For S%=1 To 3
If I%=S%
If Flag_dup%(S%)=1
For C%=0 To 3
Flag_dup%(C%)=0
Next C%
Else
Dec Rec_counter%
Endif
Flag_dup%(S%)=1
S%=3
Endif
Next S%
Input #1,Parameter$(1)
Input #1,Parameter$(2)
Input #1,Parameter$(3)
Input #1,Parameter$(4)
T_vol%(I%,Rec_counter%)=Val(Parameter$(1))
T_pitch%(I%,Rec_counter%)=Val(Parameter$(2))
T_octave%(I%,Rec_counter%)=Val(Parameter$(3))
T_sdur%(I%,Rec_counter%)=Val(Parameter$(4))
Goto Tape_still_loading
Endif
If Left$(Parameter$(0),4)="Wave"
If Flag_dup%(0)=1
For C%=1 To 3
Flag_dup%(C%)=0
Next C%
Else
Dec Rec_counter%
Endif
Flag_dup%(0)=1
Input #1,Parameter$(1)
Input #1,Parameter$(2)
Input #1,Parameter$(3)
Input #1,Parameter$(4)
T_voice%(Rec_counter%)=Val(Right$(Parameter$(0),2))
T_env%(Rec_counter%)=Val(Parameter$(1))
T_form%(Rec_counter%)=Val(Parameter$(2))
T_len%(Rec_counter%)=Val(Parameter$(3))
T_wdur%(Rec_counter%)=Val(Parameter$(4))
Goto Tape_still_loading
Endif
Tape_still_loading:
Until Eof(#1)
Tape_loaded:
Close
If Rec_counter%>63
Rec_counter%=63
Endif
Gosub Reset_tape_parameters
Goto Process_done
Endif
If X%>610 And X%<634 ! Save Recorded Tape
Fileselect "\*.LST","",File$
If File$=""
Goto Process_done
Endif
File$=File$+".LST"
Open "O",#1,File$
For I%=1 To 3
Zero_flag%(I%)=0
Next I%
For I%=0 To Rec_counter%
For J%=1 To 3
If T_vol%(J%,I%) Or Zero_flag%(J%)
Print #1,"Sound ";J%;",";T_vol%(J%,I%);",";T_pitch%(J%,I%);
Print #1,",";T_octave%(J%,I%);",";T_sdur%(J%,I%)
If T_vol%(J%,I%)
Zero_flag%(J%)=1
Else
Zero_flag%(J%)=0
Endif
Endif
Next J%
If T_voice%(I%)
Print #1,"Wave ";T_voice%(I%);",";T_env%(I%);",";T_form%(I%);
Print #1,",";T_len%(I%);",";T_wdur%(I%)
Endif
Next I%
Print #1,"Sound 1,0,0,0,0"
Print #1,"Sound 2,0,0,0,0"
Print #1,"Sound 3,0,0,0,0"
Print #1,"Wave 0,0,0,0,0"
Close
Goto Process_done
Endif
Endif
Rem ----------------------------------------------------------------------
Endif
Process_done:
Loop
Rem ************************************************************************
Rem * SUBROUTINES *
Rem ************************************************************************
Rem
Procedure Eof_error
If Err=26
Resume Tape_loaded
Else
Error Err
End
Endif
Return
Procedure Toggle_buttons(X1_new%,Y1_new%,X2_new%,Y2_new%)
Graphmode 3
If Toggle_flag%
Pbox X1_box%,Y1_box%*Res%,X2_box%,Y2_box%*Res%
Endif
X1_box%=X1_new%
Y1_box%=Y1_new%
X2_box%=X2_new%
Y2_box%=Y2_new%
Pbox X1_box%,Y1_box%*Res%,X2_box%,Y2_box%*Res%
Toggle_flag%=1
Return
Rem --------------------------------------------------------------------------
Procedure Tape_erase
For I%=Tape_counter% To 64
For J%=1 To 3
T_vol%(J%,I%)=0
T_pitch%(J%,I%)=0
T_octave%(J%,I%)=0
T_sdur%(J%,I%)=0
Next J%
T_voice%(I%)=0
T_env%(I%)=0
T_form%(I%)=0
T_len%(I%)=0
T_wdur%(I%)=0
Next I%
Return
Rem --------------------------------------------------------------------------
Procedure Tape_stop
Sound 1,0,0,0,0
Sound 2,0,0,0,0
Sound 3,0,0,0,0
Wave 0,0
Gosub Toggle_buttons(378,181,606,191)
Repeat
K%=Mousek
Until K%=0
Deffill 2
Pbox X1_box%,Y1_box%*Res%,X2_box%,Y2_box%*Res%
Toggle_flag%=0
If Mode%<>Mode_direct%
For I%=1 To 3
Volume%(I%)=T_vol%(I%,Tape_counter%)
Ptch%(I%)=T_pitch%(I%,Tape_counter%)
Scale%(I%)=T_octave%(I%,Tape_counter%)
Dur%(I%)=T_sdur%(I%,Tape_counter%)
Next I%
Voice%(0)=T_voice%(Tape_counter%)
Envelope%=T_env%(Tape_counter%)
Frm%=T_form%(Tape_counter%)
F_len%=T_len%(Tape_counter%)
W_dur%(0)=T_wdur%(Tape_counter%)
Endif
Mode%=0
Flag_sound_change%=1
Return
Rem -------------------------------------------------------------------------
Procedure Reset_tape_parameters
Graphmode 1
Deffill 2,2,8
For I%=1 To 2
Pbox 350,132*Res%,606,142*Res%
Pbox 610,132*Res%,634,142*Res%
Deffill 1,0,0
Next I%
'
For I%=354 To 602 Step 4
Line I%,132*Res%,I%,142*Res%
Next I%
Graphmode 1
Text 612,140*Res%,"0"
Text 624,140*Res%,"0"
Line 622,132*Res%,622,142*Res%
Tape_counter%=0
X_ticker%=351
Deffill 1,2,8
Gosub Tape_update
Return
Rem -------------------------------------------------------------------------
Procedure Tape_rewind
Dec Tape_counter%
Deffill 2
Graphmode 3
Gosub Tape_update
Sub X_ticker%,4
Return
Rem --------------------------------------------------------------------------
Procedure Tape_forward
If Tape_counter%<63
Inc Tape_counter%
Add X_ticker%,4
Deffill 3
Graphmode 3
Gosub Tape_update
Endif
Return
Rem -------------------------------------------------------------------------
Procedure Tape_update
Pbox X_ticker%-1,132*Res%,X_ticker%+3,142*Res%
Line X_ticker%-1,132*Res%,X_ticker%-1,142*Res%
'
Graphmode 1
Text 612,140*Res%," "
Text 624,140*Res%," "
Text 612,140*Res%,Int(Tape_counter%/10)
Text 624,140*Res%,Tape_counter%-Int(Tape_counter%/10)*10
J%=0
If Flag_carry_over%=0
For I%=1 To 3
Volume%(I%)=T_vol%(I%,Tape_counter%)
Text 123,(31+J%)*Res%," "
Text 123,(31+J%)*Res%,Volume%(I%)
Ptch%(I%)=T_pitch%(I%,Tape_counter%)
Text 185,(31+J%)*Res%," "
Text 185,(31+J%)*Res%,Ptch%(I%)
Scale%(I%)=T_octave%(I%,Tape_counter%)
Text 245,(31+J%)*Res%," "
Text 245,(31+J%)*Res%,Scale%(I%)
Dur%(I%)=T_sdur%(I%,Tape_counter%)
Temp%=Dur%(I%)
Num%=10000
For K%=0 To 4
Text 282+K%*12,(31+J%)*Res%," "
Text 282+K%*12,(31+J%)*Res%,Int(Temp%/Num%)
Sub Temp%,Int(Temp%/Num%)*Num%
Div Num%,10
Next K%
Add J%,38
Next I%
Voice%(0)=T_voice%(Tape_counter%)
Temp%=T_voice%(Tape_counter%)
Num%=10
For K%=0 To 1
Text 93+K%*12,168*Res%," "
Text 93+K%*12,168*Res%,Int(Temp%/Num%)
Sub Temp%,Int(Temp%/Num%)*Num%
Div Num%,10
Next K%
Envelope%=T_env%(Tape_counter%)
Text 133,168*Res%," "
Text 133,168*Res%,Envelope%
Frm%=T_form%(Tape_counter%)
Text 178,168*Res%," "
Text 178,168*Res%,Frm%
F_len%(0)=T_len%(Tape_counter%)
Temp%=T_len%(Tape_counter%)
Num%=10000
For K%=0 To 4
Text 205+K%*12,168*Res%," "
Text 205+K%*12,168*Res%,Int(Temp%/Num%)
Sub Temp%,Int(Temp%/Num%)*Num%
Div Num%,10
Next K%
W_dur%(0)=T_wdur%(Tape_counter%)
Temp%=T_wdur%(Tape_counter%)
Num%=10000
For K%=0 To 4
Text 265+K%*12,168*Res%," "
Text 265+K%*12,168*Res%,Int(Temp%/Num%)
Sub Temp%,Int(Temp%/Num%)*Num%
Div Num%,10
Next K%
Gosub Set_voice_box
Gosub Set_env_box
Gosub Set_form_box
Endif
Flag_carry_over%=0
Return
Rem ----------------------------------------------------------------------
Procedure Hear_it
Hear_start:
For I%=1 To 3
If Mode%=Mode_direct%
Dur_sound%=0
Else
Dur_sound%=Dur%(I%)
Endif
If Volume%(I%)
Sound I%,Volume%(I%),Ptch%(I%),Scale%(I%),Dur_sound%
Hear_sound%(I%)=1
Else
If Hear_sound%(I%)=1
Sound I%,0,0,0,0
Hear_sound%=0
Endif
Endif
Next I%
If Mode%=Mode_direct%
Dur_wave%=0
Else
Dur_wave%=W_dur%(0)
Endif
If Voice%(0)
Wave Voice%(0),Envelope%,Frm%,F_len%(0),Dur_wave%
Hear_wave%=1
Else
If Hear_wave%=1
Wave 0,0
Hear_wave%=0
Goto Hear_start
Endif
Endif
If Mode%<>Mode_direct%
Sound 1,0,0,0,0
Sound 2,0,0,0,0
Sound 3,0,0,0,0
Wave 0,0
Endif
Return
Rem -------------------------------------------------------------------------
Procedure Set_voice_box
Graphmode 3
Num%=1
For I%=1 To 6
If (Voice%(0) And Num%) And Voice_box%(I%)=0
Pbox 350,(71+I%*8)*Res%,495,(79+I%*8)*Res%
Voice_box%(I%)=1
Goto Check_voice
Endif
If (Voice%(0) And Num%)=0 And Voice_box%(I%)
Pbox 350,(71+I%*8)*Res%,495,(79+I%*8)*Res%
Voice_box%(I%)=0
Endif
Check_voice:
Mul Num%,2
Next I%
Return
Rem -------------------------------------------------------------------------
Procedure Set_env_box
Graphmode 3
Num%=1
For I%=1 To 3
If (Envelope% And Num%) And Env_box%(I%)=0
Pbox 502,(71+I%*8)*Res%,634,(79+I%*8)*Res%
Env_box%(I%)=1
Goto Check_env
Endif
If (Envelope% And Num%)=0 And Env_box%(I%)
Pbox 502,(71+I%*8)*Res%,634,(79+I%*8)*Res%
Env_box%(I%)=0
Endif
Check_env:
Mul Num%,2
Next I%
Return
Rem -------------------------------------------------------------------------
Procedure Set_form_box
Graphmode 3
If Frm%<11
X_new_form%=350
I%=0
Else
X_new_form%=492
I%=11
Endif
For Y_new_form%=13 To 53 Step 10
Srch_frm:
If Frm%=I%
Pbox X_old_form%,Y_old_form%*Res%,X_old_form%+142,(Y_old_form%+10)*Res%
Pbox X_new_form%,Y_new_form%*Res%,X_new_form%+142,(Y_new_form%+10)*Res%
X_old_form%=X_new_form%
Y_old_form%=Y_new_form%
Y_new_form%=63
Endif
If I%<3 Or (I%>3 And I%<7)
Inc I%
Goto Srch_frm
Endif
Inc I%
Next Y_new_form%
Return
Rem --------------------------------------------------------------------------
Procedure Screen_initialize
Deftext 1,0,0,6
For I%=1 To 35
Read X1%,Y1%,X2%,Y2%
Y1%=Y1%*Res%
Y2%=Y2%*Res%
If I%<27
Deffill 2,2,8
Pbox X1%,Y1%,X2%,Y2%
Deffill 1,0,0
Else
Deffill 1,2,8
Endif
Pbox X1%,Y1%,X2%,Y2%
Next I%
For I%=1 To 22
Read X%,Y1%,Y2%
Y1%=Y1%*Res%
Y2%=Y2%*Res%
Line X%,Y1%,X%,Y2%
Next I%
For I%=1 To 22
Read X%,Y%
Text X%,Y%*Res%,Chr$(1)
Text X%,(Y%+21)*Res%,Chr$(2)
Next I%
Get 0,12*Res%,339,44*Res%,Plate$
Put 0,50*Res%,Plate$
Put 0,88*Res%,Plate$
For I%=1 To 19
Read X1%,Y1%,X2%,Y2%
Y1%=Y1%*Res%
Y2%=Y2%*Res%
Line X1%,Y1%,X2%,Y2%
Next I%
For X%=393 To 475 Step 13
Line X%,35*Res%,X%+13,41*Res%
Line X%+13,35*Res%,X%+13,41*Res%
Next X%
For X%=393 To 449 Step 26
Line X%,55*Res%,X%+13,61*Res%
Line X%+13,61*Res%,X%+26,55*Res%
Next X%
For X%=535 To 625 Step 13
Line X%,31*Res%,X%+13,25*Res%
Line X%+13,25*Res%,X%+13,31*Res%
Next X%
For X%=535 To 591 Step 26
Line X%,51*Res%,X%+13,45*Res%
Line X%+13,45*Res%,X%+26,51*Res%
Next X%
For Y%=23 To 53 Step 10
Line 350,Y%*Res%,634,Y%*Res%
Next Y%
For I%=1 To 41
Read X%,Y%,A$
Text X%,Y%*Res%,A$
Next I%
'
Box 91,185*Res%,323,195*Res%
Text 110,192*Res%,"About Sound Wave Stylist"
Get 487,171*Res%,498,177*Res%,Arrow$
Put 456,147*Res%,Arrow$
Put 456,159*Res%,Arrow$
Put 560,171*Res%,Arrow$
Put 572,171*Res%,Arrow$
Get 400,171*Res%,411,177*Res%,Arrow$
Put 412,171*Res%,Arrow$
Gosub Reset_tape_parameters
Graphmode 3
Pbox 350,13*Res%,492,23*Res%
Return
Rem ------------------------------------------------------------------------
Data 28,0,339,10,92,12,339,23,28,23,339,33,92,33,339,44,91,137,323,147,91,149
Data 323,160,45,160,323,170,91,170,323,181,350,0,634,13,350,13,492,63,492,13
Data 634,63,350,65,495,78,350,78,495,128,502,65,634,78,502,78,634,105,502,108
Data 634,128,448,144,536,156,448,156,536,168,448,168,536,180,377,168,448,180
Data 536,168,607,180,377,180,607,192,392,150,432,162,552,150,592,162,350,144
Data 374,192,610,144,634,192
Data 470,185,514,187,487,171,489,177,490,172,492,176,493,173,495,175,496,174
Data 498,174,400,174,402,174,403,173,405,175,406,172,408,176,409,171,411,177
Rem
Data 92,12,43,160,12,43,216,12,43,280,12,43,292,12,43
Data 304,12,43,316,12,43,328,12,43,91,149,181,103,149,181,115,149,181,159,149
Data 181,203,149,181,215,149,181,227,149,181,239,149,181,251,149,181,263,149
Data 181,275,149,181,287,149,181,299,149,181,311,149,181
Rem
Data 123,20,185,20,245,20,282,20,294,20,306,20,318,20,330,20,93,157,105,157
Data 133,157,178,157,205,157,217,157,229,157,241,157,253,157,265,157,277,157
Data 289,157,301,157,313,157
Rem
Data 393,15,406,21,406,21,488,21,393,31,406,25,406,25,406,31,406,31,488,31,393
Data 45,406,51,406,51,488,51,471,55,484,61,535,15,548,21,548,15,548,21,548,15
Data 630,15,535,41,548,35,548,35,630,35,613,51,626,45,535,61,548,55,548,55,548
Data 61,548,61,630,61,389,13,389,63,531,13,531,63
Rem
Data 32,31,"Sound 1",32,69,"Sound 2",32,107,"Sound 3",52,168,"Wave"
Data 40,8,"Voice Volume Pitch Octave Dur"
Data 93,145,"Voc Env Form Len Dur",476,9,"FORM"
Data 358,21,"0-3",508,21,"11",358,31,"4-7",508,31,"12",358,41," 8"
Data 508,41,"13",358,51," 9",508,51,"14",358,61," 10",508,61,"15"
Data 375,74,"VOICE (Active)",367,86,"1 = Channel 1",367,94,"2 = Channel 2"
Data 367,102,"4 = Channel 3",367,110,"8 = Noise On 1",359,118,"16 = Noise On 2"
Data 359,126,"32 = Noise On 3",537,74,"ENVELOPE",517,86,"1 = Channel 1"
Data 517,94,"2 = Channel 2",517,102,"4 = Channel 3",552,121,"QUIT"
Data 400,159,"REC",560,159,"ERA",472,153,"Direct",472,165,"Current"
Data 358,159,"L",358,167,"O",358,175,"A",358,183,"D",618,159,"S",618,167,"A"
Data 618,175,"V",618,183,"E"